var req=null;
var READY_STATE_UNINITIALIZED=0;
var READY_STATE_LOADING=1;
var READY_STATE_LOADED=2;
var READY_STATE_INTERACTIVE=3;
var READY_STATE_COMPLETE=4;

sendRequest = function ( url, params, HttpMethod, callbackKDealNoResult ) {

	if ( !HttpMethod ){
		HttpMethod="GET";
	}
	req=initXMLHTTPRequest();	
		
	if ( req ) {
		req.onreadystatechange=callbackKDealNoResult;
		req.open(HttpMethod, url, true );
		req.setRequestHeader ( "Content-Type", "application/x-www-form-urlencoded");
		req.send (params);
	}
}

isdnSendRequest = function( url, params, HttpMethod, callbackKDealNoResult ) {

	if ( !HttpMethod ){
		HttpMethod="GET";
	}
	req=initXMLHTTPRequest();	
		
	if ( req ) {
		req.onreadystatechange=callbackKDealNoResult;
		req.open(HttpMethod, url, false );
		req.setRequestHeader ( "Content-Type", "application/x-www-form-urlencoded");
		req.send (params);
	}
}
 initXMLHTTPRequest = function(){
	var xRequest=null;
	if (window.XMLHttpRequest) {
		xRequest=new XMLHttpRequest();
	} else if ( window.ActiveXObject ){
		xRequest = new ActiveXObject("Microsoft.XMLHTTP");
	}
	return xRequest;
}


 onReadyState = function() {
	var ready=req.readyState;
	var jsonObject=null;
	
	if ( ready == READY_STATE_COMPLETE ){
			jsonObject=eval( "("+ req.responseText +")" );
		  toFinalConsole ( jsonObject );
	}
}
